<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
	<title>搜索关键词“{$word}”-{$webconf['web_name']}</title>
<meta name="keywords" content="搜索关键词“{$word}”" />
<meta name="description" content="搜索关键词“{$word}”" />
{include="style"}

</head>

<body>
    {include="nav"}
    <main class="page blog-post-list">
        <section class="clean-block clean-blog-list dark">
            <div class="container">
                <div class="block-heading">
                    <h2 class="text-info">搜索列表页展示</h2>
                    <p>经典Foreach模板标签使用</p>
                </div>
                <div class="block-content article-list">
				{if($lists)}
				{foreach $lists as $v}
                    <div class="clean-blog-post">
                        <div class="row">
                            <div class="col-lg-5"><img class="rounded img-fluid" src="{if($v['litpic']=='')}{$tpl}assets/img/tech/image4.jpg{else}{$v['litpic']}{/if}"></div>
                            <div class="col-lg-7">
                                <h3>【{$v['id']}】{$v['title']}</h3>
                                <div class="info"><span class="text-muted">{fun date('Y-m-d',$v['addtime'])}&nbsp;<a >{fun get_info_table('level',['id'=>$v['userid']],'name')}</a></span></div>
                                <p>{fun newstr($v['description'],150)}</p><a href="{$v['url']}"><button class="btn btn-outline-primary btn-sm" type="button">了解更多</button></a></div>
                        </div>
                    </div>
				{/foreach}
				{else}
				<p>暂时没有数据~</p>
				{/if}
				<!--判断端口，手机端不显示分页-->
				{if(!isMobile())}
				  <nav>
					<ul class="pagination">
					
					{if($listpage['list'])}
						<li class="page-item {if($listpage['prev'])}disabled{/if}"><a class="page-link" href="{$listpage['prev']}" aria-label="Previous"><span aria-hidden="true">«</span></a></li>
						{foreach $listpage['list'] as $ss}
						<li class="page-item {if($ss['num']==$listpage['current_num'])}active background{/if}"><a href="{$ss['url']}" class="page-link">{$ss['num']}</a></li>
						{/foreach}
						<li class="page-item {if($listpage['next'])}disabled{/if}"><a class="page-link" href="{$listpage['next']}" aria-label="Next"><span aria-hidden="true">»</span></a></li>
					{/if}
					</ul>
				</nav>
				{/if}
                </div>
            </div>
        </section>
    </main>
   {include="footer"}
   <script>
<!--判断端口，手机端下拉加载-->
{if(isMobile())}
var p={$frpage};
var istrue = true;
$(window).scroll(function () {
	//判断是否滑动到页面底部
	
	if ($(window).scrollTop() === ($(document).height() - $(window).height()) ) {
		//防止过度加载
		if(!istrue){
			return false;
		}
		p+=1;
		
		$.ajax({
			url:window.location.href,//请求的url地址
			// dataType:"json",//返回格式为json
			async:true,//请求是否异步，默认为异步，这也是ajax重要特性
			data:{ajax:1,ajax_tpl:1,page:p},//参数值
			type:"GET",//请求方式
			beforeSend:function(){
				//请求前的处理
				istrue = false;
				
			},
			 success:function(r){
				if(r==1){
					alert('没有了~');return false;
				}
				$(".article-list").append(r);
					
			},
			complete:function(){
			//请求完成的处理
				istrue = true;
			},
			 error:function(){
			//请求出错处理
				alert('网络错误');
			}

					
			
		})
	}
})

{/if}
   </script>
</body>

</html>